using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;using Maxleaf.EDI.Domain.K3;

namespace Maxleaf.EDI.DataAccess.K3
{
    public class ICPurchaseImpMap : EntityTypeConfiguration<ICPurchaseImp>
    {
        public ICPurchaseImpMap()
        {
            // Primary Key
            this.HasKey(t => t.FDetailID);

            // Properties
            this.Property(t => t.FHSBillNo)
                .IsRequired()
                .HasMaxLength(30);

            this.Property(t => t.FPayStyle)
                .IsRequired()
                .HasMaxLength(60);

            this.Property(t => t.FSupplyInvoiceNo)
                .IsRequired()
                .HasMaxLength(30);

            this.Property(t => t.FTradeClause)
                .IsRequired()
                .HasMaxLength(50);

            this.Property(t => t.FLadingNo)
                .IsRequired()
                .HasMaxLength(30);

            this.Property(t => t.FTransportationNo)
                .IsRequired()
                .HasMaxLength(25);

            this.Property(t => t.FContainerNo)
                .IsRequired()
                .HasMaxLength(100);

            this.Property(t => t.FGoodsMark)
                .IsRequired()
                .HasMaxLength(255);

            this.Property(t => t.FShipPort)
                .IsRequired()
                .HasMaxLength(50);

            this.Property(t => t.FTransShipPort)
                .IsRequired()
                .HasMaxLength(50);

            this.Property(t => t.FDestPort)
                .IsRequired()
                .HasMaxLength(50);

            this.Property(t => t.FInsureAgent)
                .IsRequired()
                .HasMaxLength(60);

            this.Property(t => t.FLossTelNo)
                .IsRequired()
                .HasMaxLength(60);

            this.Property(t => t.FPayPlace)
                .IsRequired()
                .HasMaxLength(60);

            this.Property(t => t.FInsurant)
                .IsRequired()
                .HasMaxLength(60);

            this.Property(t => t.FCommRemark)
                .IsRequired()
                .HasMaxLength(50);

            this.Property(t => t.FFurtcommRemark)
                .IsRequired()
                .HasMaxLength(50);

            this.Property(t => t.FBackupNo)
                .IsRequired()
                .HasMaxLength(255);

            // Table & Column Mappings
            this.ToTable("ICPurchaseImp");
            this.Property(t => t.FDetailID).HasColumnName("FDetailID");
            this.Property(t => t.FEntryID).HasColumnName("FEntryID");
            this.Property(t => t.FInterID).HasColumnName("FInterID");
            this.Property(t => t.FHSSupplyID).HasColumnName("FHSSupplyID");
            this.Property(t => t.FHSBillNo).HasColumnName("FHSBillNo");
            this.Property(t => t.FPayStyle).HasColumnName("FPayStyle");
            this.Property(t => t.FRPDate).HasColumnName("FRPDate");
            this.Property(t => t.FSupplyInvoiceNo).HasColumnName("FSupplyInvoiceNo");
            this.Property(t => t.FSRCCountryID).HasColumnName("FSRCCountryID");
            this.Property(t => t.FTradetermID).HasColumnName("FTradetermID");
            this.Property(t => t.FTradeClause).HasColumnName("FTradeClause");
            this.Property(t => t.FPayTaxesStatus).HasColumnName("FPayTaxesStatus");
            this.Property(t => t.FTradeStyleID).HasColumnName("FTradeStyleID");
            this.Property(t => t.FLadingNo).HasColumnName("FLadingNo");
            this.Property(t => t.FTransportationNo).HasColumnName("FTransportationNo");
            this.Property(t => t.FContainerNo).HasColumnName("FContainerNo");
            this.Property(t => t.FGoodsMark).HasColumnName("FGoodsMark");
            this.Property(t => t.FShipDate).HasColumnName("FShipDate");
            this.Property(t => t.FShipPort).HasColumnName("FShipPort");
            this.Property(t => t.FTransShipPort).HasColumnName("FTransShipPort");
            this.Property(t => t.FDestPort).HasColumnName("FDestPort");
            this.Property(t => t.FEstimateArrivalDate).HasColumnName("FEstimateArrivalDate");
            this.Property(t => t.FTransStyleID).HasColumnName("FTransStyleID");
            this.Property(t => t.FTransAmount).HasColumnName("FTransAmount");
            this.Property(t => t.FInsurePlusRate).HasColumnName("FInsurePlusRate");
            this.Property(t => t.FInsureAmount).HasColumnName("FInsureAmount");
            this.Property(t => t.FInsureTypeID).HasColumnName("FInsureTypeID");
            this.Property(t => t.FInsureRate).HasColumnName("FInsureRate");
            this.Property(t => t.FInsureFee).HasColumnName("FInsureFee");
            this.Property(t => t.FInsureAgent).HasColumnName("FInsureAgent");
            this.Property(t => t.FLossTelNo).HasColumnName("FLossTelNo");
            this.Property(t => t.FPayPlace).HasColumnName("FPayPlace");
            this.Property(t => t.FInsurant).HasColumnName("FInsurant");
            this.Property(t => t.FCommRate).HasColumnName("FCommRate");
            this.Property(t => t.FCommAmount).HasColumnName("FCommAmount");
            this.Property(t => t.FFurtCommRate).HasColumnName("FFurtCommRate");
            this.Property(t => t.FFurtCommAmount).HasColumnName("FFurtCommAmount");
            this.Property(t => t.FCommRemark).HasColumnName("FCommRemark");
            this.Property(t => t.FFurtcommRemark).HasColumnName("FFurtcommRemark");
            this.Property(t => t.FGoodsMark_Tag).HasColumnName("FGoodsMark_Tag");
            this.Property(t => t.FBackupNo).HasColumnName("FBackupNo");
            this.Property(t => t.FPaytaxDate).HasColumnName("FPaytaxDate");
        }
    }
}
